home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 July / 1984-07.d64 / bonk barrels_64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  121 lines

  1. 100 print"[147][159]       redefining character set"
  2. 110 goto390
  3. 120 rem man jumps
  4. 130 pokee%,39
  5. 140 for x=1toz%:gosub250:if peek(b%(x))>36andpeek(b%(x))<40 then910
  6. 145 if peek(b%(x)+d(x))>36andpeek(b%(x)+d(x))<40then910
  7. 147 if peek(b%(x)-1)>36andpeek(b%(x)-1)<40then910
  8. 150 gosub 310:nextx
  9. 160 pokee%,37
  10. 170 pokes,p
  11. 180 p=p+3
  12. 190 pokee%,38
  13. 200 forx=1toz%:gosub250:if peek(b%(x))>36andpeek(b%(x))<40 then910
  14. 203 if peek(b%(x)+d(x))>36andpeek(b%(x)+d(x))<40then910
  15. 205 if peek(b%(x)-1)>36andpeek(b%(x)-1)<40then910
  16. 210 gosub 310:nextx
  17. 220 ifpeek(e%-40)=llthen 910
  18. 230 pokee%,32:e%=e%-40:pokee%,38:pokes,0:pokee%,32:e%=e%-40:pokee%,38:return
  19. 240 rem move barrels
  20. 250 pokes+1,o
  21. 260 pokeb%(x),c
  22. 270 ifpeek(b%(x)+i%)=wthenb%(x)=b%(x)+d(x)
  23. 280 ifpeek(b%(x))=wthenb%(x)=b%(x)-t%*d(x)
  24. 290 ifpeek(b%(x)+i%)<>wthenb%(x)=b%(x)+i%
  25. 300 return
  26. 310 pokeb%(x),ll
  27. 320 ifb%(x)>jthengosub350
  28. 330 return
  29. 340 rem reset barrels
  30. 350 forx=1toz%:pokeb%(x),c:b%(x)=sr+int(rnd(x)*t%):nextx
  31. 360 rem score
  32. 370 print"score    [157][157][157][157]"sc;"         [157][157][157][157][157][157]";
  33. 380 forq=3toa+1step-1:print"[146]%";:next:print"":return
  34. 390 poke53281,0:poke53280,6
  35. 400 poke56,48:clr
  36. 410 poke56334,peek(56334)and254:poke1,peek(1)and251
  37. 420 bl$="[158]                                        "
  38. 430 al$="[146][156]$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
  39. 440 fori=0to1023:pokei+12288,peek(i+53248):pokei+13312,peek(i+53248):next
  40. 450 poke1,peek(1)or4
  41. 460 poke56334,peek(56334)or1
  42. 470 poke53272,(peek(53272)and240)+12
  43. 480 fori=12544to12544+8*8-1:reada:pokei,a:next:gosub1080
  44. 490 data0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,108,206,174,234,230,108,56:rem barrel
  45. 500 data56,108,246,250,134,222,108,56:rem barrel
  46. 510 data255,153,189,153,255,0,0,0:rem beam
  47. 520 data56,56,16,56,84,16,56,40:rem man normal
  48. 530 data186,186,84,56,16,16,56,40,0,0,0,56,56,16,124,170
  49. 540 sr=1025:k=55296-sr+1
  50. 550 j=sr+820:v=54296:s=54272:fori=stov:pokei,0:nexti
  51. 560 pokev,15:pokes+5,130:pokes+6,72
  52. 570 sr=1025:k=55296-sr+1
  53. 580 print"[147]":a=0:sc=0:z%=4
  54. 590 rem set up screen
  55. 600 print"[147]";:bl=80
  56. 610 fori=1to10:printbl$;al$;:next:printbl$;bl$;""
  57. 620 x=sr+39:pokes+4,33:pokes+24,15
  58. 630 forb=1tobl
  59. 640 r=int(rnd(x)*908)
  60. 650 pokex+r,32:pokex+r+k,7:pokes+1,b+10:next:pokes+4,0
  61. 660 pokes+4,17:forg=-1to20
  62. 670 pokex+g*40,36:pokes+1,50+(g*2):pokex+g*40+k,5
  63. 680 pokex+39+(g*40),36:pokes+1,0:pokex+39+(g*40)+k,5:nextg:pokes+4,0
  64. 690 rem prep for loop
  65. 700 e%=j:d(1)=1:d(2)=-1:d(3)=1:d(4)=-1:l=1:lm=10:rm=18:up=5:bm=4:o=0
  66. 710 w=36:c=32:kb=197:t%=38:i%=40:ll=34:d=37:z=245:p=128:tt%=1:th%=3:gosub350
  67. 720 rem main game loop
  68. 730 for x=1toz%:gosub250:ifpeek(b%(x))>36andpeek(b%(x))<40 then910
  69. 735 if peek(b%(x)+d(x))>36andpeek(b%(x)+d(x))<40then910
  70. 737 rem   if peek(b%(x)-1)>36andpeek(b%(x)-1)<40then910
  71. 740 gosub 310:nextx
  72. 750 ifpeek(e%)=llthene%=e%+40:pokee%+k,7:pokee%+i%,36:pokee%+i%+k,4:goto910
  73. 760 ifpeek(e%-i%)=llthen910
  74. 770 ifpeek(e%+i%)=llthenpokee%,c:e%=e%+80:goto910
  75. 780 ifll=34thenll=35:goto800
  76. 790 ll=34
  77. 800 pokee%,c
  78. 810 ifpeek(kb)=lmthenifpeek(e%-l)<>wthene%=e%-l:pokee%,d:yg=-2:goto850
  79. 820 ifpeek(kb)=rmthenifpeek(e%+l)<>wthene%=e%+l:pokee%,d:yg=2:goto850
  80. 830 ifpeek(kb)=bmthenifpeek(e%-i%)=wthenpokee%-i%,c:sc=sc-5:p=p-10
  81. 840 ifpeek(kb)=upthenifpeek(e%-i%)<>wthengosub130:sc=sc+l+l:p=p+3:pokee%,d
  82. 850 ifp>zthenp=128
  83. 860 pokee%,d:pokes+4,17:pokes+1,40
  84. 870 if e%<srthene%=j:tt%=tt%+l:gosub370:ifsc>35thenz%=rnd(x)*4+1
  85. 880 iftt%>th%thengoto600
  86. 890 goto730
  87. 900 rem lose man
  88. 910 pokes+4,129:n=15:pokes,39:pokes+1,09:forq=1to4:pokeb%(q),32:next
  89. 920 pokee%,38:pokee%-40,34:gosub1190:pokee%,37:gosub1190:pokee%,39:gosub1190
  90. 930 pokee%-40,194:pokee%,35:gosub1190:pokee%+1,173:pokee%-1,173:pokee%+40,194
  91. 940 pokee%-39,206:pokee%-41,205
  92. 950 pokee%+41,205:pokee%+39,206:gosub1190
  93. 960 pokee%-120,174:pokee%-2,174:pokee%+2,174:pokee%+120,174:gosub1190
  94. 970 pokee%-78,174
  95. 980 pokee%-82,174:pokee%+78,174:pokee%+82,174:gosub1190
  96. 990 sc=sc-8:pokes+4,128:a=a+1:gosub370
  97. 1000 tt%=1:ifa<3goto600
  98. 1010 print"[147]";
  99. 1015 poke198,0:print"      game over"
  100. 1018 print"              score= ";sc
  101. 1020 print"      hit space bar to play again"
  102. 1030 print"          any other key to end"
  103. 1040 getyy$:ifyy$=""then1040
  104. 1050 if yy$<>" "then print"[147]":end
  105. 1060 goto580
  106. 1070 rem
  107. 1080 print"[147]":printtab(11)"*instructions*":print
  108. 1090 printtab(9)"a[146] moves man left":printtab(9)"d[146] moves man right"
  109. 1100 print:printtab(9)"f3[146] moves man up 1 level"
  110. 1110 printtab(9)"f1[146] will blast space above"
  111. 1120 print:printtab(9)"   **points**"
  112. 1130 print:printtab(9)"2 for each up":printtab(8)"-5 for using blast"
  113. 1140 printtab(8)"-8 for getting hit"
  114. 1150 print"":printtab(8)"   press space bar[159]"
  115. 1160 getxx$:ifxx$=""then1160
  116. 1170 return
  117. 1180 rem time and sound for lose man rountine
  118. 1190 n=n-2:ifn<0thenn=0
  119. 1200 ifpeek(e%)=38orpeek(e%)=39thenforq=1to50:next
  120. 1210 forq=1to25:next:return
  121.